package com.aya.simple;

import java.util.ArrayList;
import java.util.List;

public class WeatherSubject {

    private WeatherDto data;


    public void setData(WeatherDto data) {
        this.data = data;
    }

    List<Observable> list = new ArrayList<>();

    public void add(Observable observable) {
        list.add(observable);
    }

    public void remove(Observable observable) {
        list.remove(observable);
    }

    public void notifyObservable() {
        for (Observable observable : list) {
            observable.update(data);
        }
    }


}
